/*
 * @Descripttion: 
 * @version: 1.0
 * @Author: LiYansheng
 * @Date: 2022-04-28 13:11:10
 * @LastEditors: CoderXZ
 * @LastEditTime: 2022-05-04 23:09:39
 */
import request from '@/utils/request'

// 查询
export function search(form) {
    return request({
        url: '/student',
        method: 'post',
        data: {
            "pageIndex": form.pageIndex,
            "pageSize": form.pageSize,
            "classNo": form.classNo,
            "major": form.major,
            "college": form.college,
            "school": form.school,
            "name": form.name,
            "studentAccount": form.studentAccount,
            "idCard": form.idCard
        }
    })
}

// 添加
export function add(form) {
    return request({
        url: '/student/add',
        method: 'post',
        data: {
            "studentAccount": form.studentAccount,
            "name": form.name,
            "sex": form.sex,
            "nation":form.nation,
            "idCard": form.idCard,
            "phone": form.phone,
            "qq": form.qq,
            "email": form.email,
            "homeAddress": form.homeAddress,
            "political": form.political,
            "graduationTime": form.graduationTime,
            "degree": form.degree,
            "classId":form.classNo,
            "avatar":form.avatar,
            "empStatus": form.empStatus
        }
    })
}

// 删除
export function del(id) {
    return request({
        url: '/student/delete',
        method: 'post',
        data:{
            id:id
        }
    })
}

// 修改
export function update(form) {
    return request({
        url: '/student/update',
        method: 'post',
        data: {
            "id": form.id,
            "studentAccount": form.studentAccount,
            "name": form.name,
            "sex": form.sex,
            "nation":form.nation,
            "idCard": form.idCard,
            "phone": form.phone,
            "qq": form.qq,
            "email": form.email,
            "homeAddress": form.homeAddress,
            "political": form.political,
            "graduationTime": form.graduationTime,
            "degree": form.degree,
            "classId":form.classId ,
            "avatar":form.avatar,
            "empStatus": form.empStatus
        }
    })
}

// 批量删除
export function delList(ids) {
    return request({
        url: '/student/delList',
        method: 'post',
        data: {
            ids: ids
        }
    })
}

// 获取可用学校名及id
export function searchSchool() {
    return request({
        url: '/school',
        method: 'get',
    })
}

export function searchCollege(id) {
    return request({
        url: '/college/find',
        method: 'post',
        data: {
            id: id
        }
    })
}

export function getStudentBase() {
    return request({
        url: '/student',
        method: 'get',
    })
}

